export const week = [
  {
    label: "第1周",
    value: 1,
  },
  {
    label: "第2周",
    value: 2,
  },
  {
    label: "第3周",
    value: 3,
  },
  {
    label: "第4周",
    value: 4,
  },
  {
    label: "第5周",
    value: 5,
  },
  {
    label: "第6周",
    value: 6,
  },
  {
    label: "第7周",
    value: 7,
  },
  {
    label: "第8周",
    value: 8,
  },
  {
    label: "第9周",
    value: 9,
  },
  {
    label: "第10周",
    value: 10,
  },
  {
    label: "第11周",
    value: 11,
  },
  {
    label: "第12周",
    value: 12,
  },
  {
    label: "第13周",
    value: 13,
  },
  {
    label: "第14周",
    value: 14,
  },
  {
    label: "第15周",
    value: 15,
  },
  {
    label: "第16周",
    value: 16,
  },
  {
    label: "第17周",
    value: 17,
  },
  {
    label: "第18周",
    value: 18,
  },
  {
    label: "第19周",
    value: 19,
  },
  {
    label: "第20周",
    value: 20,
  },
  {
    label: "第21周",
    value: 21,
  },
  {
    label: "第22周",
    value: 22,
  },
  {
    label: "第23周",
    value: 23,
  },
  {
    label: "第24周",
    value: 24,
  },
  {
    label: "第25周",
    value: 25,
  },
  {
    label: "第26周",
    value: 26,
  },
  {
    label: "第27周",
    value: 27,
  },
  {
    label: "第28周",
    value: 28,
  },
  {
    label: "第29周",
    value: 29,
  },
  {
    label: "第30周",
    value: 30,
  },
  {
    label: "第31周",
    value: 31,
  },
  {
    label: "第32周",
    value: 32,
  },
  {
    label: "第33周",
    value: 33,
  },
  {
    label: "第34周",
    value: 34,
  },
  {
    label: "第35周",
    value: 35,
  },
  {
    label: "第36周",
    value: 36,
  },
  {
    label: "第37周",
    value: 37,
  },
  {
    label: "第38周",
    value: 38,
  },
  {
    label: "第39周",
    value: 39,
  },
  {
    label: "第40周",
    value: 40,
  },
  {
    label: "第41周",
    value: 41,
  },
  {
    label: "第42周",
    value: 42,
  },
  {
    label: "第43周",
    value: 43,
  },
  {
    label: "第44周",
    value: 44,
  },
  {
    label: "第45周",
    value: 45,
  },
  {
    label: "第46周",
    value: 46,
  },
  {
    label: "第47周",
    value: 47,
  },
  {
    label: "第48周",
    value: 48,
  },
  {
    label: "第49周",
    value: 49,
  },
  {
    label: "第50周",
    value: 50,
  },
  {
    label: "第51周",
    value: 51,
  },
  {
    label: "第52周",
    value: 52,
  },
]


export const currentWeek = ()=>{
    const now = new Date();
    const startOfYear = new Date(now.getFullYear(), 0, 1);
    const oneDay = 24 * 60 * 60 * 1000;
    const dayOfYear = Math.floor((now - startOfYear) / oneDay);
    const weekNumber = Math.ceil((dayOfYear + startOfYear.getDay() + 1) / 7);
    
    // 确保周数在1-52之间
    const currentWeekNumber = Math.min(Math.max(weekNumber, 1), 52);
    
    return currentWeekNumber;
}